package com.ukao.pad.adapter;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.widget.ImageView;
import android.widget.TextView;

import com.mcxtzhang.commonadapter.rv.CommonAdapter;
import com.mcxtzhang.commonadapter.rv.ViewHolder;
import com.ukao.pad.R;
import com.ukao.pad.bean.BatchlistBean;
import com.ukao.pad.utils.CheckUtils;


import java.util.List;

/**
 * Created by ukaodev on 2017/6/14.
 */

public class AddBatchDialogAdapter extends CommonAdapter<BatchlistBean> {



    public AddBatchDialogAdapter(Context context, List<BatchlistBean> item) {
        super(context, item, R.layout.adapter_dialog_batch_details);
    }

    @Override
    public void convert(ViewHolder holder, BatchlistBean item) {



        ImageView   selectCheckbox=(ImageView) holder.itemView.findViewById(R.id.select_checkbox);
        TextView   orderNumber=(TextView) holder.itemView.findViewById(R.id.order_number);
        TextView   clothingBarcode=(TextView) holder.itemView.findViewById(R.id.clothing_barcode);
        TextView   serve=(TextView) holder.itemView.findViewById(R.id.serve);
        TextView   money=(TextView) holder.itemView.findViewById(R.id.money);
        TextView   productName=holder.getView(R.id.productName);

        money.setText(CheckUtils.isEmptyNumber(item.getSubtotal())+"");
        productName.setText(item.getProductName());
        orderNumber.setText(item.getOrderNo());
        clothingBarcode.setText(item.getScanCode());
        serve.setText(item.getServiceName());


//        if(item.isCheck()){
//            Drawable drawable= mContext.getResources().getDrawable(R.drawable.check_box_check);
//            selectCheckbox.setImageDrawable(drawable);
//
//        }else{
//            Drawable drawable=  mContext.getResources().getDrawable(R.drawable.check_box_normal);
//            /// 这一步必须要做,否则不会显示.
//            selectCheckbox.setImageDrawable(drawable);
//
//        }







    }








}
